const categoryService = require("@/server/category");
const { successData, sendCode } = require("@/utils/r/result");
const category = {
  async GetOption(req, res) {
    successData(res, await categoryService.GetOption());
  },
  async GetList(req, res) {
    successData(res, await categoryService.GetList(req.query));
  },
  async SaveOrUpdate(req, res) {
    sendCode(res, await categoryService.SaveOrUpdate(req.body));
  },
  async Delete(req, res) {
    sendCode(res, await categoryService.Delete(req.body));
  },
};

module.exports = category;
